<HTML><HEAD><TITLE>current_error(?N)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Event Handling</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>current_error(?N)</H1>
Succeeds if N unifies with a valid error number.


<DL>
<DT><EM>N</EM></DT>
<DD>Positive integer or variable.
</DD>
</DL>
<H2>Description</H2>
   Used to generate on backtracking all the current valid error numbers.  N
   is a variable.

<P>
   Also used to check that N is a valid error number.  N is an integer.

<P>

<H3>Modes and Determinism</H3><UL>
<LI>current_error(+) is semidet
<LI>current_error(-) is multi
</UL>
<H3>Fail Conditions</H3>
Fails if N is not a valid error number.
<H3>Exceptions</H3>
<DL>
<DT><EM>(5) type error </EM>
<DD>N is instantiated, but not to an integer.
</DL>
<H2>Examples</H2>
<PRE>
Success:
      ?- current_error(N).
      N = 1     More? (;)       % type `;'
      N = 2     More? (;)
      N = 4     More? (;)
      N = 5     More? (;)       % carriage return typed
      yes.

      ?- [user].
       list_error1(String, N, Message) :-
              current_error(N),
              error_id(N, Message),
              substring(Message, String, _).
       user compiled 208 bytes in 0.03 seconds

      ?- list_error1("def",N,M).
      N = 21
      M = "undefined arithmetic expression"     More? (;)
      yes.

Fail:
      current_error(3).

Error:
      current_error(1.0).   (Error 5).



</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/event/error_id-2.html">error_id / 2</A>
</BODY></HTML>
